#!/bin/bash
#PBS -A lc_op
#PBS -l nodes=4:ppn=1
#PBS -l walltime=00:20:00
#PBS -l pvmem=1000mb
#PBS -o qespresso.out
#PBS -j oe
#PBS -N C2H4
#PBS -m n
#PBS -V


cd $PBS_O_WORKDIR
echo $PBS_O_WORKDIR

# Setup all manual parameters here
# Must be ABSOLUTE paths
NP=$(wc -l $PBS_NODEFILE | awk '{print $1}')
echo $NP

exe_qespresso=/usr/usc/qespresso/5.1/gnu/bin/pw.x
exe_export=/usr/usc/qespresso/5.1/gnu/bin/pw_export.x
exe_convert=/usr/usc/qespresso/5.1/gnu/bin/iotk
res=/staging/op/akimov/pyx_1/Tut2_small/step2/res/

# These will be assigned automatically, leave them as they are
param1=
param2=


# This is invocation of the scripts which will further handle NA-MD calclculations
# on the NAC calculation step
python -c "from PYXAID import *
params = { }
params[\"BATCH_SYSTEM\"]=\"mpirun\"
params[\"NP\"]=$NP
params[\"EXE\"]=\"$exe_qespresso\"
params[\"EXE_EXPORT\"]=\"$exe_export\"
params[\"EXE_CONVERT\"] = \"$exe_convert\"
params[\"start_indx\"]=$param1
params[\"stop_indx\"]=$param2
params[\"wd\"]=\"wd_test\"
params[\"rd\"]=\"$res\"
params[\"minband\"]=1
params[\"nocc\"]=6
params[\"maxband\"]=20
params[\"nac_method\"]=0
params[\"wfc_preprocess\"]=\"complete\"
params[\"do_complete\"]=1
params[\"prefix0\"]=\"x0.scf\"
params[\"prefix1\"]=\"x1.scf\"
params[\"compute_Hprime\"]=1
print params
runMD1.runMD(params)
"


